let scrollBackTopBehavior = Behavior({
  behaviors: [],
  properties: {
  },
  data: {
    topNum: 0,
    distance:900
  },
  created() {
    // console.log(this.properties.distance);
  },
  attached: function () {
  },
  methods: {
    // 获取滚动条当前位置
    scrolltoupper: function (e) {
      // console.log(e)
      if (e.detail.scrollTop > this.properties.distance) {
        this.setData({
          cangotop: true
        });
      } else {
        this.setData({
          cangotop: false
        });
      }
    },

    //回到顶部
    goTop: function (e) { // 一键回到顶部
      this.setData({
        topNum: 0
      });
    },
  }
})
export {
  scrollBackTopBehavior

} // 导出